/**
 * 作者: wgx
 * 日期: 2024-12-16 16:36:53
 * 备注: 宝箱物品表
 */
package com.motu.monstercity.server.game.commondata.bag;

import io.vertx.core.json.JsonObject;

public class BoxItemModel {
    protected int id; // Id
    protected int boxId; // 宝箱id
    protected int itemId; // 物品Id
    protected long itemNum; // 物品数量
    protected int rate; // 随机宝箱开出的概率

    public BoxItemModel() {
    }

    public BoxItemModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        boxId = obj.containsKey("box_id") ? obj.getInteger("box_id") : 0;
        itemId = obj.containsKey("item_id") ? obj.getInteger("item_id") : 0;
        itemNum = obj.containsKey("item_num") ? obj.getLong("item_num") : 0;
        rate = obj.containsKey("rate") ? obj.getInteger("rate") : 0;
    }

    public int getId() {
        return id;
    }

    public int getBoxId() {
        return boxId;
    }

    public int getItemId() {
        return itemId;
    }

    public long getItemNum() {
        return itemNum;
    }

    public int getRate() {
        return rate;
    }

}
